package love.contact.adapter;


import java.util.List;
import love.contact.data.Contact;
import love.contact.engine.Engine;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

/**
 * 
 * @author Administrator
 *
 */

public class ContactListAdatper extends BaseAdapter 
{
	private LayoutInflater mInflater;
	List<Contact> contactArray;

	public ContactListAdatper(Context context)
	{
		mInflater = LayoutInflater.from(context);
		//contactArray=Engine.getInstance().getPhoneBook().getContactArray();
	}

	public int getCount()
	{
		int size=contactArray.size();
		return size;
	}

	public long getItemId(int position)
	{
		return position;
	}
	
	public Object getItem(int position) {
        return position;
    }

	public View getView(int position, View convertView, ViewGroup parent)
	{
        if (convertView == null) 
        {
            convertView = mInflater.inflate(android.R.layout.simple_list_item_1, null);
        }
        
        String text=contactArray.get(position).getDisplayName();
        
        TextView textView=(TextView)convertView;
        textView.setText(text);
        textView.setTextSize(18);

        return convertView;
	}

}
